package ke02.am.calculating;

public class WrongFactorial {

	public static long fac(long n) {
		if (n > 1) {
			return n * fac(n - 1);
		}
		if (n == 0) {
			return 1;
		}
		if (n < 0) {
			throw new IllegalArgumentException("Negative numbers are bad");
		}
		return n;
	}

	public static void main(String[] args) {
		System.out.println("3! = " + fac(3));
	}

}
